<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">

    <title>广告列表</title>
    <hdjs />
    <js file= '__PUBLIC__/js/mod.base.js,__PUBLIC__/js/mod.ad.js' />
    <css file= '__PUBLIC__/css/mod.base.css' />
</head>
<body>

	<script type="text/javascript" src="http://localhost/hdphp/hdcms/Static/cal/lhgcalendar.min.js"></script>
	<form class="hd-form" method="get">
	
		
		<div class="search">
			添加时间：
			<input id="begin_time" placeholder="开始时间" readonly="readonly" class="hd-w80" type="text" value="{$Think.get.search_begin_time}" name="search_begin_time">
			<script>
				$('#begin_time').calendar({
					format : 'yyyy-MM-dd'
				});
			</script>
			-
			<input id="end_time" placeholder="结束时间" readonly="readonly" class="hd-w80" type="text" value="{$Think.get.search_end_time}" name="search_end_time">
			<script>
				$('#end_time').calendar({
					format : 'yyyy-MM-dd'
				});
			</script>
			&nbsp;&nbsp;&nbsp;

			<select name="position_psid" class="hd-w100">
				<option  value="">全部</option>
				<foreach name='position' item='v'>
				<option  value="{$v.psid}" <if condition='$v["psid"] eq $_GET["position_psid"]'>selected='selected'</if>>{$v.position_name}</option>
				</foreach>
			
			</select>
			&nbsp;&nbsp;&nbsp;
			<button class="hd-btn hd-btn-xm" type="button" onclick="location.href='{:U('Ad/index')}'">所有广告</button>
			&nbsp;&nbsp;&nbsp;
			<select name="keytype" class="hd-w100">
				<option value="name" <if condition ='$_GET["keytype"] eq "article_title"'> selected='selected'</if>>标题</option>
				<option value="username" <if condition ='$_GET["keytype"] eq "username"'> selected='selected'</if>>用户名</option>
			</select>
			&nbsp;&nbsp;&nbsp;
					关键字：
			<input class="hd-w200" type="text" placeholder="请输入关键字..." value="{$Think.get.keyword}" name="keyword">
			<button class="hd-btn hd-btn-xm" type="submit">搜索</button>

			
		    <input type="hidden" name="verifystate" value="{$Think.get.verifystate}"/>
		</div>
	</form>
	<div class="hd-menu-list">
		<ul>
			<li <if condition='$_GET["verifystate"] eq 2'>class="active"</if>>
				<a href="{:U('Ad/index',array('verifystate'=>2))}">广告列表</a>
			</li>
			<li <if condition='$_GET["verifystate"] eq 1'>class="active"</if>>
				<a href="{:U('Ad/index',array('verifystate'=>1))}">未审核</a>
			</li>
			<li>
				<a href="{:U('Ad/add',array('verifystate'=>1))}" >添加广告</a>
			</li>
		</ul>
	</div>
	
	<form action = '{:U("Ad/beachdelete")}' method='post' name="operationForm">

		<table class="hd-table hd-table-list hd-form">
			<thead>
				<tr>
					<td class="hd-w30">
						<input type="checkbox" id="selectAllContent"/>
					</td>
					<td class="hd-w30">排序</td>
					<td class="hd-w30">aid</td>

					<td >位置</td>
					<td>标题</td>
					<td >图片</td>
					<td class="hd-w50">状态</td>
					<td class="hd-w100">作者</td>
					<td class="hd-w120">操作</td>
				</tr>
			</thead>
			<if condition = '$data'>
				<foreach name='data' item='v'>
					<tr>
						<td class="hd-w30">
							<input type="checkbox"  name="aid[{$v.aid}]" value="{$v.aid}" />
						</td>
						<td class="hd-w30"><input type='text' class='hd-w30' name="sort[{$v.aid}]" value="{$v.sort}"></td>
						<td class="hd-w30">{$v.aid}</td>

						<td >{$v.position_name}</td>
						<td>{$v.name}</td>
						<td >
						<if condition='$v["pic"]'>
						<img src="__ROOT__/{$v.pic}" height="50">
						</if>
						</td>
						<td class="hd-w50">{$v.verifystate|set_verifystate}</td>
						<td class="hd-w100">{$v.username}</td>

						<td class="hd-w120">
							
							<a href="{:U('Ad/edit',array('psid'=>$v['position_psid'],'aid'=>$v['aid'],'verifystate'=>$_GET['verifystate']))}">编辑</a>
							|
							<a href="javascript:;" onclick="del_modal('{:U('Ad/del',array('psid'=>$v['position_psid'],'aid'=>$v['aid'],'verifystate'=>$_GET['verifystate']))}')">删除</a>
						</td>
					</tr>
				</foreach>
				<tr>
				<td colspan="9" class='page'>{$page}</td>
				</tr>
			<else />
			<tr>
				<td colspan="9">没有找到符合的记录</td>
			</tr>
			</if>

		</table>
		<div class="hd-page"></div>
		<input type="hidden" name="psid" value="{$Think.get.psid}"/>
		<input type="hidden" name="verifystate" value="{$Think.get.verifystate}"/>
		<input type="button" class="hd-btn hd-btn-xm select_all"  value="全选" />
		<input type="button" class="hd-btn hd-btn-xm operation"  value="更改排序" name="update_sort"/>

		<input type="button" class="hd-btn hd-btn-xm operation"  value="批量删除" name="update_del"/>

		<input type="button" class="hd-btn hd-btn-xm operation"  value="审核" name="update_check_state"/>
		<input type="button" class="hd-btn hd-btn-xm operation"  value="取消审核" name="update_cancle_state"/>


		

	</form>
	
</body>
</html>